#include "datos_utiles.h"
#include "ui_datos_utiles.h"

datos_utiles::datos_utiles(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::datos_utiles)
{
    ui->setupUi(this);
}

datos_utiles::~datos_utiles()
{
    delete ui;
}

void datos_utiles::llenarDatos(coordenadas cords, struct terna lati1, struct terna longi1)
{
    QString lati, longi;
    char f = 'g';
    int prec = 6;
    lati = QString::number(lati1.grados,f, prec) + QString::fromAscii("° ", -1)+ QString::number(lati1.minutos,f, prec) + "' "+ QString::number(lati1.segundos,f, prec)+ "''";
    longi = QString::number(longi1.grados,f, prec) + "° "+ QString::number(longi1.minutos,f, prec) + "' "+ QString::number(longi1.segundos,f, prec)+ "''";

    this->ui->latLabel->setText(lati);
    this->ui->longLabel_2->setText(longi);
    //ui->combustibleLabel->setText();
    //ui->dist0Label->setText();
    this->ui->distResLabel->setText(QString::number(cords.distRestante,  f, prec));
    //ui->gastoCombLabel->setText();
    this->ui->horaLlegadaLabel->setText(QString::number(cords.TiempitoArriboProm, f, prec));
    this->ui->tiempoRecLabel->setText(QString::number(cords.tiempoDeRecorrido,  f, prec));
    this->ui->velActualLabel->setText(QString::number(cords.VelocidadActual, f, prec));
    this->ui->velPromLabel->setText(QString::number(cords.VelocidadPromedioTotal, f, prec));

}
